﻿using System;

namespace RedisDemos.Extensions
{
    public static class ConsoleExtensions
    {
        public static void LogInfo<T>(this T actual, params Object[] arg) where T : struct
        {
            LogInfo(actual.ToString(), arg);
        }

        public static void LogInfo(this String actual, params Object[] arg)
        {
            Console.WriteLine(actual ?? String.Empty, arg);
        }

        public static void LogError(this String actual, params Object[] arg)
        {
            var old = Console.ForegroundColor;
            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine(actual ?? String.Empty, arg);
            Console.ForegroundColor = old;
        }
    }
}
